/*
               File: TipoDocume
        Description: Tipo de Documento
             Author: GeneXus Java Generator version 8_0_9-040
       Generated on: 28 de Setiembre de 2010 13:4:18.77
       Program type: Callable routine
          Main DBMS: sqlserver
*/
import com.genexus.*;
import com.genexus.ui.*;
import com.genexus.db.*;
import com.genexus.distributed.*;
import com.genexus.uifactory.*;
import java.sql.*;

/* Client and Server side code */
public final class ttipodocume extends GXTransaction
{
   public ttipodocume( int remoteHandle )
   {
      super( remoteHandle , new ModelContext( ttipodocume.class ), "" );
   }

   public ttipodocume( int remoteHandle ,
                       ModelContext context )
   {
      super( remoteHandle , context, "" );
   }

   public void init_no_key099( )
   {
      A54TipDocN = "" ;
      A179TipDoc = GXutil.nullDate() ;
      A181TipDoc = "" ;
      A180TipDoc = "" ;
      A182TipDoc = GXutil.nullDate() ;
      A184TipDoc = "" ;
      A183TipDoc = "" ;
      A185TipDoc = 0 ;
      O54TipDocN = A54TipDocN ;
      X178TipDoc = O178TipDoc ;
      X54TipDocN = O54TipDocN ;
   }

   public void init_all099( )
   {
      AV34Pgmdes = "Tipo de Documento" ;
      Gx_BScreen = 0 ;
      A178TipDoc = "1" ;
      A53TIPDOCC = 0 ;
      K53TIPDOCC = A53TIPDOCC ;
      geteqAfterKey = (byte)(1) ;
      clear( ) ;
      O178TipDoc = A178TipDoc ;
      init_no_key099( ) ;
   }

   public void samod_set_ins( )
   {
      A178TipDoc = i178TipDoc ;
      cmbTipDocEst.setValue(A178TipDoc);
   }

   public void reset_caption_090( )
   {
   }

   /* Client side code */
   public void sa_startup( )
   {
      sa_startup_srv( ) ;
      disable_std_buttons( ) ;
      enable_disable( ) ;
   }

   protected String getObjectName( )
   {
      return "TipoDocume" ;
   }

   protected String getFrmTitle( )
   {
      return "_" ;
   }

   protected GXMenuBar getMenuBar( )
   {
      return null ;
   }

   protected int getFrmTop( )
   {
      return 0 ;
   }

   protected int getFrmLeft( )
   {
      return 0 ;
   }

   protected int getFrmWidth( )
   {
      return 360 ;
   }

   protected int getFrmHeight( )
   {
      return 161 ;
   }

   protected String getHelpId( )
   {
      return "HLP_TTipoDocume.htm";
   }

   protected int getFrmBackground( )
   {
      return UIFactory.getColor(15) ;
   }

   protected int getFrmForeground( )
   {
      return UIFactory.getColor(6) ;
   }

   protected boolean isMainProgram( )
   {
      return false;
   }

   protected boolean isModal( )
   {
      return true ;
   }

   protected boolean hasDBAccess( )
   {
      return true ;
   }

   protected int getRefreshTimeout( )
   {
      return 0 ;
   }

   public boolean getRefreshTimeoutAlways( )
   {
      return true ;
   }

   protected boolean getPaintAfterStart( )
   {
      return true ;
   }

   protected int getBorderStyle( )
   {
      return 3 ;
   }

   protected boolean getMaxButton( )
   {
      return false ;
   }

   protected boolean getMinButton( )
   {
      return false ;
   }

   protected boolean getCtrlBox( )
   {
      return true ;
   }

   protected boolean getShowInTaskbar( )
   {
      return true ;
   }

   protected String getFormIcon( )
   {
      return "" ;
   }

   protected boolean getAutocenter( )
   {
      return true ;
   }

   public void execute( short aP0 ,
                        String aP1 ,
                        String aP2 ,
                        String aP3 ,
                        String aP4 ,
                        String aP5 )
   {
      execute_int(aP0, aP1, aP2, aP3, aP4, aP5);
   }

   private void execute_int( short aP0 ,
                             String aP1 ,
                             String aP2 ,
                             String aP3 ,
                             String aP4 ,
                             String aP5 )
   {
      ttipodocume.this.AV16Tipdoc = aP0;
      ttipodocume.this.AV31Tipdoc = aP1;
      ttipodocume.this.AV32Prgcod = aP2;
      ttipodocume.this.Gx_mode = aP3;
      ttipodocume.this.AV15Userid = aP4;
      ttipodocume.this.AV9Cad = aP5;
      start();
   }

   protected void screen( )
   {
      GXPanel1 = new GXPanel(this, 3 , 21 , 360 , 161 );
      this.setIBackground(UIFactory.getColor(15));
      this.setIForeground(UIFactory.getColor(6));
      GXPanel1.refreshFrame();
      edtTIPDOCCOD = new GUIObjectShort ( new GXEdit(4, "ZZZZ", UIFactory.getFont( "Arial", 0, 8),166, 16, 34, 20, GXPanel1, false, ILabelConstants.BORDER_3D, GXTypeConstants.NUMERIC, false, true) , GXPanel1 , 166 , 16 , 34 , 20 , UIFactory.getColor(5) , UIFactory.getColor(8) , UIFactory.getFont( "Arial", 0, 8) , false , "A53TIPDOCC" );
      ((GXEdit) edtTIPDOCCOD.getGXComponent()).setAlignment(ILabelConstants.RIGHT);
      edtTIPDOCCOD.addFocusListener(this);
      edtTIPDOCCOD.getGXComponent().setHelpId("HLP_TTipoDocume.htm");
      edtTipDocNom = new GUIObjectString ( new GXEdit(20, "@!", UIFactory.getFont( "Arial", 0, 8),166, 42, 110, 20, GXPanel1, false, ILabelConstants.BORDER_3D, GXTypeConstants.CHAR, false, true) , GXPanel1 , 166 , 42 , 110 , 20 , UIFactory.getColor(5) , UIFactory.getColor(8) , UIFactory.getFont( "Arial", 0, 8) , true , "A54TipDocN" );
      ((GXEdit) edtTipDocNom.getGXComponent()).setAlignment(ILabelConstants.LEFT);
      edtTipDocNom.addFocusListener(this);
      edtTipDocNom.getGXComponent().setHelpId("HLP_TTipoDocume.htm");
      cmbTipDocEst = new GUIObjectString ( new GXComboBox(GXPanel1) , GXPanel1 , 166 , 66 , 63 , 20 , UIFactory.getColor(5) , UIFactory.getColor(8) , UIFactory.getFont( "Arial", 0, 8) , true , "A178TipDoc" );
      ((GXComboBox) cmbTipDocEst.getGXComponent()).addItem( "1","Activo");
      ((GXComboBox) cmbTipDocEst.getGXComponent()).addItem( "0","Inactivo");
      cmbTipDocEst.addFocusListener(this);
      cmbTipDocEst.addItemListener(this);
      cmbTipDocEst.getGXComponent().setHelpId("HLP_TTipoDocume.htm");
      bttBtn_enter = UIFactory.getGXButton( GXPanel1 , "&Aceptar" ,  23 ,  115 ,  118 ,  31 , UIFactory.getFont( "MS Shell Dlg", 0, 8) );
      bttBtn_enter.setTooltip("Aceptar");
      bttBtn_enter.addActionListener(this);
      bttBtn_cancel = UIFactory.getGXButton( GXPanel1 , "&Salir" ,  206 ,  115 ,  118 ,  31 , UIFactory.getFont( "MS Shell Dlg", 0, 8) );
      bttBtn_cancel.setTooltip("Salir");
      bttBtn_cancel.addActionListener(this);
      bttBtn_cancel.setFiresEvents(false);
      lbllbl6 = UIFactory.getLabel(GXPanel1, "Codigo", ILabelConstants.LEFT, Integer.MAX_VALUE, UIFactory.getColor(8), UIFactory.getFont( "Arial", 0, 8), false, ILabelConstants.BORDER_NONE , 70 , 19 , 33 , 14 );
      lbllbl8 = UIFactory.getLabel(GXPanel1, "Nombre", ILabelConstants.LEFT, Integer.MAX_VALUE, UIFactory.getColor(8), UIFactory.getFont( "Arial", 0, 8), false, ILabelConstants.BORDER_NONE , 70 , 45 , 37 , 14 );
      lbllbl10 = UIFactory.getLabel(GXPanel1, "Estado", ILabelConstants.LEFT, Integer.MAX_VALUE, UIFactory.getColor(8), UIFactory.getFont( "Arial", 0, 8), false, ILabelConstants.BORDER_NONE , 70 , 69 , 33 , 14 );
      rctrct9 = UIFactory.getGXRectangle( GXPanel1 , 1 , 4 , 5 , 350 , 97 , Integer.MAX_VALUE , UIFactory.getColor(8) , ILabelConstants.BORDER_SINGLE );
      rctRecuadro = UIFactory.getGXRectangle( GXPanel1 , 1 , 4 , 106 , 350 , 50 , UIFactory.getColor(192, 192, 192) , UIFactory.getColor(224, 224, 224) , ILabelConstants.BORDER_3D );
      focusManager.setControlList(new IFocusableControl[] {
                edtTIPDOCCOD ,
                edtTipDocNom ,
                cmbTipDocEst ,
                bttBtn_enter ,
                bttBtn_cancel
      });
   }

   protected void setFocusFirst( )
   {
      valid_tipdoccod();
      setFocus(edtTipDocNom, true);
   }

   public void reloadDynamicLists( int id )
   {
   }

   public void clear( )
   {
      init_no_key099( ) ;
   }

   public void disable_std_buttons( )
   {
      if ( ( GXutil.strcmp(Gx_mode, "DSP") == 0 ) )
      {
         bttBtn_enter.setGXEnabled( 0 );
         edtTIPDOCCOD.setEnabled( 0 );
         edtTipDocNom.setEnabled( 0 );
         cmbTipDocEst.setEnabled( 0 );
         setFocus(bttBtn_enter, true);
      }
   }

   public void set_caption( )
   {
      if ( ( IsConfirmed == 1 ) && ( AnyError == 0 ) )
      {
         if ( ( GXutil.strcmp(Gx_mode, "DLT") == 0 ) )
         {
            context.msgStatus( localUtil.getMessages().getMessage("confdelete") );
         }
         else
         {
            context.msgStatus( localUtil.getMessages().getMessage("mustconfirm") );
         }
         bttBtn_enter.setCaption( localUtil.getMessages().getMessage("captionconfirm") );
         bttBtn_enter.setTooltip( localUtil.getMessages().getMessage("captionconfirm") );
      }
      else if ( ( GXutil.strcmp(Gx_mode, "INS") == 0 ) )
      {
         bttBtn_enter.setCaption( localUtil.getMessages().getMessage("captionadd") );
         bttBtn_enter.setTooltip( localUtil.getMessages().getMessage("captionadd") );
      }
      else if ( ( GXutil.strcmp(Gx_mode, "UPD") == 0 ) )
      {
         bttBtn_enter.setCaption( localUtil.getMessages().getMessage("captionupdate") );
         bttBtn_enter.setTooltip( localUtil.getMessages().getMessage("captionupdate") );
      }
      else if ( ( GXutil.strcmp(Gx_mode, "DLT") == 0 ) )
      {
         bttBtn_enter.setCaption( localUtil.getMessages().getMessage("captiondelete") );
         bttBtn_enter.setTooltip( localUtil.getMessages().getMessage("captiondelete") );
      }
      else
      {
      }
   }

   public void after_trn( )
   {
      if ( ( trnEnded == 1 ) )
      {
         /* Execute user event: E11092 */
         E11092 ();
         trnEnded = 0 ;
         if (!cleanedUp) {
            sanomod( ) ;
            if ( (GXutil.strcmp(Gx_mode, "INS")==0) )
            {
               /* Clear variables for new insertion. */
               init_all099( ) ;
               sanomod( ) ;
               samod( ) ;
            }
         }
      }
   }

   protected boolean hasStatusBar( )
   {
      return true;
   }

   public void refreshArray( String array )
   {
   }

   protected void GXEnter( )
   {
      btn_enter( ) ;
      if (!cleanedUp) {
         VariablesToControls();
         set_caption( );
      }
   }

   protected void GXStart( )
   {
      sa_startup( ) ;
      VariablesToControls();
      /* Execute Start event if defined. */
      /* Execute user event: E12092 */
      E12092 ();
   }

   protected void actionEventDispatch( Object eventSource )
   {
      lastAnyError = AnyError ;
      AnyError = 0;
      if ( bttBtn_cancel.isEventSource(eventSource) ) {
         if (canCleanup())
            cleanup();

         return;
      }
      if ( bttBtn_enter.isEventSource(eventSource) ) {
         if ( ( lastAnyError != 0 ) )
         {
            return;
         }
         btn_enter( ) ;
         if (!cleanedUp) {
            VariablesToControls();
            set_caption( );
         }
         return;
      }
   }

   protected void setCurrentGXCursor( Object eventSource )
   {
      if ( edtTIPDOCCOD.isEventSource(eventSource) ) {
         setGXCursor( edtTIPDOCCOD.getGXCursor() );
         return;
      }
      if ( edtTipDocNom.isEventSource(eventSource) ) {
         setGXCursor( edtTipDocNom.getGXCursor() );
         return;
      }
      if ( cmbTipDocEst.isEventSource(eventSource) ) {
         setGXCursor( cmbTipDocEst.getGXCursor() );
         return;
      }
   }

   protected void gotFocusEventDispatch( Object eventSource )
   {
   }

   protected void focusEventDispatch( Object eventSource )
   {
      AnyError = 0 ;
      if ( edtTipDocNom.isEventSource(eventSource) ) {
         valid_tipdocnom ();
         return;
      }
      if ( cmbTipDocEst.isEventSource(eventSource) ) {
         valid_tipdocest ();
         return;
      }
      if ( edtTIPDOCCOD.isEventSource(eventSource) ) {
         valid_tipdoccod ();
         return;
      }
   }

   protected void updateAttributes( Object eventSource )
   {
      if ( edtTIPDOCCOD.isEventSource(eventSource) ) {
         A53TIPDOCC = edtTIPDOCCOD.getValue() ;
         return;
      }
      if ( edtTipDocNom.isEventSource(eventSource) ) {
         A54TipDocN = edtTipDocNom.getValue() ;
         return;
      }
      if ( cmbTipDocEst.isEventSource(eventSource) ) {
         A178TipDoc = cmbTipDocEst.getValue() ;
         return;
      }
   }

   protected void itemEventDispatch( Object eventSource )
   {
   }

   public void mouseEventDispatch( Object eventSource ,
                                   int modifier )
   {
   }

   public boolean keyEventDispatch( Object eventSource ,
                                    int keyCode )
   {
      if (triggerEventEnter(eventSource, keyCode)) {
         AnyError = 0;
         btn_enter( ) ;
         if (!cleanedUp) {
            VariablesToControls();
            set_caption( );
         }
         return true ;
      }
      if (keyCode == getContext().getClientPreferences().getKEY_PROMPT()) {
         return keyPromptHandler(eventSource);
      }
      return false;
   }

   public boolean isKeyControl( Object eventSource )
   {
      if ( ( edtTIPDOCCOD.isEventSource(eventSource) ) && ( ( A53TIPDOCC != edtTIPDOCCOD.getValue() ) ) )
      {
         return true;
      }
      return false;
   }

   public boolean isBodyControl( Object eventSource )
   {
      if ( ( edtTipDocNom.isEventSource(eventSource) ) && ( ( GXutil.strcmp(A54TipDocN, edtTipDocNom.getValue()) != 0 ) ) )
      {
         return true;
      }
      if ( ( cmbTipDocEst.isEventSource(eventSource) ) && ( ( GXutil.strcmp(A178TipDoc, cmbTipDocEst.getValue()) != 0 ) ) )
      {
         return true;
      }
      return false;
   }

   public boolean menuActionPerformed( String action )
   {
      return false;
   }

   protected void resetCaption( )
   {
      reset_caption_090( ) ;
   }

   protected void setAddCaption( )
   {
   }

   protected boolean getModeByParameter( )
   {
      return true ;
   }

   public IGXButton getCancelButton( )
   {
      return bttBtn_cancel ;
   }

   public IGXButton getConfirmButton( )
   {
      return bttBtn_enter ;
   }

   protected boolean keyPromptHandler( Object eventSource )
   {
      return false;
   }

   public void setNoAccept( Object eventSource )
   {
      if ( edtTipDocNom.isEventSource(eventSource) )
      {
         edtTipDocNom.setEnabled(!( (GXutil.strcmp(Gx_mode, "DLT")==0) || (GXutil.strcmp(Gx_mode, "DSP")==0) ));
      }
      if ( cmbTipDocEst.isEventSource(eventSource) )
      {
         cmbTipDocEst.setEnabled(!( (GXutil.strcmp(Gx_mode, "DLT")==0) || (GXutil.strcmp(Gx_mode, "DSP")==0) ));
      }
   }

   protected void VariablesToControls( )
   {
      edtTIPDOCCOD.setValue( A53TIPDOCC );
      edtTipDocNom.setValue( A54TipDocN );
      cmbTipDocEst.setValue( A178TipDoc );
   }

   protected void ControlsToVariables( )
   {
      A53TIPDOCC = edtTIPDOCCOD.getValue() ;
      A54TipDocN = edtTipDocNom.getValue() ;
      A178TipDoc = cmbTipDocEst.getValue() ;
   }

   protected void eventNoLevelContext( )
   {
      ControlsToVariables();
   }

   protected void eventLevelContext( )
   {
      ControlsToVariables();
   }

   protected void eventLevelResetContext( )
   {
   }

   protected void reloadGridRow( )
   {
   }

   public void valid_tipdoccod( )
   {
      if ( ( A53TIPDOCC != K53TIPDOCC ) || ( geteqAfterKey == 1 ) )
      {
         if ( ( AnyError == 0 ) )
         {
            K53TIPDOCC = A53TIPDOCC ;
            geteq_nomod( ) ;
            if ( ( GXutil.strcmp(Gx_mode, "INS") == 0 ) )
            {
               samod_set_ins( ) ;
            }
            VariablesToControls();
         }
         if ( ( AnyError == 0 ) )
         {
            geteqAfterKey = 0 ;
         }
         else
         {
            geteqAfterKey = (byte)(1) ;
         }
      }
      IsConfirmed = 0 ;
      set_caption( ) ;
   }

   public void valid_tipdocnom( )
   {
      A54TipDocN = GXutil.trim( A54TipDocN) ;
      edtTipDocNom.setValue(A54TipDocN);
      edtTipDocNom.setValue( A54TipDocN );
      if ( ((GXutil.strcmp("", GXutil.rtrim( A54TipDocN))==0)) )
      {
         GXutil.msg( me(), "Debe Ingresar Nombre de Tipo de Documento" );
         AnyError = (short)(1) ;
         setNextFocus( edtTipDocNom );
         setFocusNext();
      }
   }

   public void valid_tipdocest( )
   {
      if ( ! ( ( GXutil.strcmp(A178TipDoc, "1") == 0 ) || ( GXutil.strcmp(A178TipDoc, "0") == 0 ) ) )
      {
         GXutil.msg( me(), "Campo Estado de registro Tipo Documento fuera de rango" );
         AnyError = (short)(1) ;
         setNextFocus( cmbTipDocEst );
         setFocusNext();
      }
      reloadGridRow();
      O178TipDoc = A178TipDoc ;
      O54TipDocN = A54TipDocN ;
   }

   public void E12092( )
   {
      eventNoLevelContext();
      /* Start Routine */
      this.setCaption( AV34Pgmdes+" - "+AV15Userid );
      AV30Wrkst = context.getWorkstationId( remoteHandle) ;
      AV29Tipacu = AV16Tipdoc ;
   }

   public void E11092( )
   {
      /* After Trn Routine */
      if (canCleanup()) {
         returnInSub = true;
         cleanup();
      }
      if (true) return;
   }

   /* Server side code */
   /* Aggregate/select formulas */
   /* Vertical formulas */
   public void sa_startup_srv( )
   {
      if ( ( AnyError == 0 ) )
      {
         sanomod( ) ;
         if ( ( GXutil.strcmp(Gx_mode, "DSP") == 0 ) )
         {
            sMode9 = Gx_mode ;
            Gx_mode = "UPD" ;
            Gx_mode = sMode9 ;
         }
         samod( ) ;
         if ( ( GXutil.strcmp(Gx_mode, "INS") != 0 ) )
         {
            geteq( ) ;
            if ( ( RcdFound9 != 1 ) )
            {
               pushError( localUtil.getMessages().getMessage("noinsert") );
               AnyError = (short)(1) ;
               keepFocus();
            }
         }
         if ( ( GXutil.strcmp(Gx_mode, "INS") == 0 ) )
         {
            i178TipDoc = A178TipDoc ;
         }
      }
      set_caption( ) ;
      PreviousCaption = bttBtn_enter.getCaption() ;
   }

   public void zm099( int GX_JID )
   {
      if ( ( GX_JID == 13 ) || ( GX_JID == 0 ) )
      {
         if ( ( GXutil.strcmp(Gx_mode, "INS") != 0 ) )
         {
            Z54TipDocN = T00093_A54TipDocN[0] ;
            Z179TipDoc = T00093_A179TipDoc[0] ;
            Z181TipDoc = T00093_A181TipDoc[0] ;
            Z180TipDoc = T00093_A180TipDoc[0] ;
            Z182TipDoc = T00093_A182TipDoc[0] ;
            Z184TipDoc = T00093_A184TipDoc[0] ;
            Z183TipDoc = T00093_A183TipDoc[0] ;
            Z178TipDoc = T00093_A178TipDoc[0] ;
            Z185TipDoc = T00093_A185TipDoc[0] ;
         }
         else
         {
            Z54TipDocN = A54TipDocN ;
            Z179TipDoc = A179TipDoc ;
            Z181TipDoc = A181TipDoc ;
            Z180TipDoc = A180TipDoc ;
            Z182TipDoc = A182TipDoc ;
            Z184TipDoc = A184TipDoc ;
            Z183TipDoc = A183TipDoc ;
            Z178TipDoc = A178TipDoc ;
            Z185TipDoc = A185TipDoc ;
         }
      }
   }

   public void sanomod( )
   {
      AV34Pgmdes = "Tipo de Documento" ;
      Gx_BScreen = 0 ;
      A53TIPDOCC = AV16Tipdoc ;
      edtTIPDOCCOD.setValue(A53TIPDOCC);
   }

   public void samod( )
   {
      if ( (GXutil.strcmp(Gx_mode, "INS")==0) && ((GXutil.strcmp("", GXutil.rtrim( A178TipDoc))==0)) && ( Gx_BScreen == 0 ) )
      {
         A178TipDoc = "1" ;
         cmbTipDocEst.setValue(A178TipDoc);
      }
      if ( ( GXutil.strcmp(Gx_mode, "DLT") == 0 ) )
      {
      }
   }

   public void ld099( )
   {
      A54TipDocN = GXutil.trim( A54TipDocN) ;
      edtTipDocNom.setValue(A54TipDocN);
      X178TipDoc = O178TipDoc ;
      X54TipDocN = O54TipDocN ;
   }

   public void checket_099( )
   {
      O178TipDoc = X178TipDoc ;
      O54TipDocN = X54TipDocN ;
      Gx_BScreen = (byte)(1) ;
      samod( ) ;
      Gx_BScreen = 0 ;
      A54TipDocN = GXutil.trim( A54TipDocN) ;
      edtTipDocNom.setValue(A54TipDocN);
      if ( ((GXutil.strcmp("", GXutil.rtrim( A54TipDocN))==0)) )
      {
         pushError( "Debe Ingresar Nombre de Tipo de Documento" );
         AnyError = (short)(1) ;
         keepFocus();
      }
      if ( ! ( ( GXutil.strcmp(A178TipDoc, "1") == 0 ) || ( GXutil.strcmp(A178TipDoc, "0") == 0 ) ) )
      {
         pushError( "Campo Estado de registro Tipo Documento fuera de rango" );
         AnyError = (short)(1) ;
         keepFocus();
      }
   }

   public void close_checket_099( )
   {
   }

   public void enable_disable( )
   {
   }

   public void getkey_099( )
   {
      /* Using cursor T00094 */
      pr_default.execute(2, new Object[] {new Short(A53TIPDOCC)});
      if ( (pr_default.getStatus(2) != 101) )
      {
         RcdFound9 = (short)(1) ;
      }
      else
      {
         RcdFound9 = 0 ;
      }
      pr_default.close(2);
   }

   public void geteq( )
   {
      /* Using cursor T00093 */
      pr_default.execute(1, new Object[] {new Short(A53TIPDOCC)});
      if ( (pr_default.getStatus(1) != 101) )
      {
         zm099( 13) ;
         RcdFound9 = (short)(1) ;
         A53TIPDOCC = T00093_A53TIPDOCC[0] ;
         A54TipDocN = T00093_A54TipDocN[0] ;
         A179TipDoc = T00093_A179TipDoc[0] ;
         A181TipDoc = T00093_A181TipDoc[0] ;
         A180TipDoc = T00093_A180TipDoc[0] ;
         A182TipDoc = T00093_A182TipDoc[0] ;
         A184TipDoc = T00093_A184TipDoc[0] ;
         A183TipDoc = T00093_A183TipDoc[0] ;
         A178TipDoc = T00093_A178TipDoc[0] ;
         A185TipDoc = T00093_A185TipDoc[0] ;
         O178TipDoc = A178TipDoc ;
         O54TipDocN = A54TipDocN ;
         Z53TIPDOCC = A53TIPDOCC ;
         sMode9 = Gx_mode ;
         Gx_mode = "DSP" ;
         ld099( ) ;
         Gx_mode = sMode9 ;
      }
      else
      {
         RcdFound9 = 0 ;
         init_no_key099( ) ;
         sMode9 = Gx_mode ;
         Gx_mode = "DSP" ;
         samod( ) ;
         Gx_mode = sMode9 ;
      }
      K53TIPDOCC = A53TIPDOCC ;
      pr_default.close(1);
   }

   public void geteq_nomod( )
   {
      getkey_099( ) ;
      if ( ( RcdFound9 == 0 ) )
      {
      }
      else
      {
      }
      geteq( ) ;
   }

   public void move_next( )
   {
      RcdFound9 = 0 ;
      /* Using cursor T00095 */
      pr_default.execute(3, new Object[] {new Short(A53TIPDOCC)});
      if ( (pr_default.getStatus(3) != 101) )
      {
         while ( (pr_default.getStatus(3) != 101) && ( ( T00095_A53TIPDOCC[0] < A53TIPDOCC ) ) )
         {
            pr_default.readNext(3);
         }
         if ( (pr_default.getStatus(3) != 101) && ( ( T00095_A53TIPDOCC[0] > A53TIPDOCC ) ) )
         {
            A53TIPDOCC = T00095_A53TIPDOCC[0] ;
            RcdFound9 = (short)(1) ;
         }
      }
      pr_default.close(3);
   }

   public void move_previous( )
   {
      RcdFound9 = 0 ;
      /* Using cursor T00096 */
      pr_default.execute(4, new Object[] {new Short(A53TIPDOCC)});
      if ( (pr_default.getStatus(4) != 101) )
      {
         while ( (pr_default.getStatus(4) != 101) && ( ( T00096_A53TIPDOCC[0] > A53TIPDOCC ) ) )
         {
            pr_default.readNext(4);
         }
         if ( (pr_default.getStatus(4) != 101) && ( ( T00096_A53TIPDOCC[0] < A53TIPDOCC ) ) )
         {
            A53TIPDOCC = T00096_A53TIPDOCC[0] ;
            RcdFound9 = (short)(1) ;
         }
      }
      pr_default.close(4);
   }

   public void btn_enter( )
   {
      if ( ( GXutil.strcmp(Gx_mode, "DLT") == 0 ) )
      {
         btn_delete( ) ;
         if	(loopOnce) cleanup();
         return  ;
      }
      nKeyPressed = (byte)(1) ;
      getkey_099( ) ;
      if ( ( RcdFound9 == 1 ) )
      {
         if ( ( GXutil.strcmp(Gx_mode, "INS") == 0 ) )
         {
            pushError( localUtil.getMessages().getMessage("noupdate") );
            AnyError = (short)(1) ;
            setNextFocus( edtTIPDOCCOD );
         }
         else if ( ( A53TIPDOCC != Z53TIPDOCC ) )
         {
            A53TIPDOCC = Z53TIPDOCC ;
            edtTIPDOCCOD.setValue(A53TIPDOCC);
            pushError( localUtil.getMessages().getMessage("getbeforeupd") );
            AnyError = (short)(1) ;
            setNextFocus( edtTIPDOCCOD );
         }
         else
         {
            /* Update record */
            update_099( ) ;
            setNextFocus( edtTIPDOCCOD );
         }
      }
      else
      {
         if ( ( A53TIPDOCC != Z53TIPDOCC ) )
         {
            /* Insert record */
            insert_099( ) ;
            setNextFocus( edtTIPDOCCOD );
         }
         else
         {
            if ( ( GXutil.strcmp(Gx_mode, "UPD") == 0 ) )
            {
               pushError( localUtil.getMessages().getMessage("recdeleted") );
               AnyError = (short)(1) ;
               setNextFocus( edtTIPDOCCOD );
            }
            else
            {
               /* Insert record */
               insert_099( ) ;
               setNextFocus( edtTIPDOCCOD );
            }
         }
      }
      handleErrors();
      after_trn( ) ;
      if ( ( sanomodError == 0 ) )
      {
         handleErrors();
      }
      setFocusNext();
      AnyError = 0 ;
      if	(loopOnce) cleanup();
   }

   public void btn_delete( )
   {
      if ( ( A53TIPDOCC != Z53TIPDOCC ) )
      {
         A53TIPDOCC = Z53TIPDOCC ;
         edtTIPDOCCOD.setValue(A53TIPDOCC);
         pushError( localUtil.getMessages().getMessage("getbeforedlt") );
         AnyError = (short)(1) ;
         setNextFocus( edtTIPDOCCOD );
      }
      else
      {
         A178TipDoc = O178TipDoc ;
         cmbTipDocEst.setValue(A178TipDoc);
         A54TipDocN = O54TipDocN ;
         edtTipDocNom.setValue(A54TipDocN);
         delete( ) ;
         handleErrors();
         after_trn( ) ;
         setNextFocus( edtTIPDOCCOD );
      }
      if ( ( AnyError != 0 ) )
      {
      }
      if ( ( sanomodError == 0 ) )
      {
         handleErrors();
      }
      setFocusNext();
   }

   public void chkps_099( )
   {
      if ( ( GXutil.strcmp(Gx_mode, "INS") != 0 ) )
      {
         /* Using cursor T00092 */
         pr_default.execute(0, new Object[] {new Short(A53TIPDOCC)});
         if ( ! (pr_default.getStatus(0) != 103) )
         {
            pushError( localUtil.getMessages().getMessage("lock", new Object[] {"MMTDO10"}) );
            AnyError = (short)(1) ;
            keepFocus();
            return  ;
         }
         Gx_longc = false ;
         if ( (pr_default.getStatus(0) == 101) || ( GXutil.strcmp(Z54TipDocN, T00092_A54TipDocN[0]) != 0 ) || !( Z179TipDoc.equals( T00092_A179TipDoc[0] ) ) || ( GXutil.strcmp(Z181TipDoc, T00092_A181TipDoc[0]) != 0 ) || ( GXutil.strcmp(Z180TipDoc, T00092_A180TipDoc[0]) != 0 ) || !( Z182TipDoc.equals( T00092_A182TipDoc[0] ) ) )
         {
            Gx_longc = true ;
         }
         if ( Gx_longc || ( GXutil.strcmp(Z184TipDoc, T00092_A184TipDoc[0]) != 0 ) || ( GXutil.strcmp(Z183TipDoc, T00092_A183TipDoc[0]) != 0 ) || ( GXutil.strcmp(Z178TipDoc, T00092_A178TipDoc[0]) != 0 ) || ( Z185TipDoc != T00092_A185TipDoc[0] ) )
         {
            pushError( localUtil.getMessages().getMessage("waschg", new Object[] {"MMTDO10"}) );
            AnyError = (short)(1) ;
            keepFocus();
            return  ;
         }
      }
   }

   public void insert_099( )
   {
      checket_099( ) ;
      if ( ( AnyError == 0 ) )
      {
         zm099( 0) ;
         chkps_099( ) ;
         if ( ( AnyError == 0 ) )
         {
            after_confirm_099( ) ;
            if ( ( AnyError == 0 ) )
            {
               /* Using cursor T00097 */
               pr_default.execute(5, new Object[] {new Short(A53TIPDOCC), A54TipDocN, A179TipDoc, A181TipDoc, A180TipDoc, A182TipDoc, A184TipDoc, A183TipDoc, A178TipDoc, new Short(A185TipDoc)});
               if ( (pr_default.getStatus(5) == 1) )
               {
                  pushError( localUtil.getMessages().getMessage("noupdate") );
                  AnyError = (short)(1) ;
                  keepFocus();
               }
               if ( ( AnyError == 0 ) )
               {
                  /* Start of After( Insert) rules */
                  /* End of After( Insert) rules */
                  if ( ( AnyError == 0 ) )
                  {
                     /* Save values for previous() function. */
                     context.msgStatus( localUtil.getMessages().getMessage("sucadded") );
                     reset_caption_090( ) ;
                  }
               }
               else
               {
                  pushError( localUtil.getMessages().getMessage("unexp") );
                  AnyError = (short)(1) ;
                  keepFocus();
               }
            }
         }
         else
         {
            ld099( ) ;
         }
         endlvl_099( ) ;
      }
      close_checket_099( ) ;
   }

   public void update_099( )
   {
      checket_099( ) ;
      if ( ( AnyError == 0 ) )
      {
         chkps_099( ) ;
         if ( ( AnyError == 0 ) )
         {
            after_confirm_099( ) ;
            if ( ( AnyError == 0 ) )
            {
               /* Using cursor T00098 */
               pr_default.execute(6, new Object[] {A54TipDocN, A179TipDoc, A181TipDoc, A180TipDoc, A182TipDoc, A184TipDoc, A183TipDoc, A178TipDoc, new Short(A185TipDoc), new Short(A53TIPDOCC)});
               if ( ( AnyError == 0 ) )
               {
                  /* Start of After( update) rules */
                  /* End of After( update) rules */
                  if ( ( AnyError == 0 ) )
                  {
                     loopOnce = true;
                  }
               }
               else
               {
                  pushError( localUtil.getMessages().getMessage("unexp") );
                  AnyError = (short)(1) ;
                  keepFocus();
               }
            }
         }
         endlvl_099( ) ;
      }
      close_checket_099( ) ;
   }

   public void delete( )
   {
      chkps_099( ) ;
      if ( ( AnyError == 0 ) )
      {
         delete_controls099( ) ;
         /* No cascading delete specified. */
         after_confirm_099( ) ;
         if ( ( AnyError == 0 ) )
         {
            /* Using cursor T00099 */
            pr_default.execute(7, new Object[] {new Short(A53TIPDOCC)});
            if ( ( AnyError == 0 ) )
            {
               /* Start of After( delete) rules */
               /* End of After( delete) rules */
               if ( ( AnyError == 0 ) )
               {
                  loopOnce = true;
               }
            }
            else
            {
               pushError( localUtil.getMessages().getMessage("unexp") );
               AnyError = (short)(1) ;
               keepFocus();
            }
         }
      }
      sMode9 = Gx_mode ;
      Gx_mode = "DLT" ;
      endlvl_099( ) ;
      Gx_mode = sMode9 ;
   }

   public void delete_controls099( )
   {
      samod( ) ;
      /* No delete mode formulas found. */
      if ( ( AnyError == 0 ) )
      {
         /* Using cursor T000910 */
         pr_default.execute(8, new Object[] {new Short(A53TIPDOCC)});
         if ( (pr_default.getStatus(8) != 101) )
         {
            pushError( localUtil.getMessages().getMessage("del", new Object[] {"Persona"}) );
            AnyError = (short)(1) ;
            keepFocus();
         }
         pr_default.close(8);
      }
   }

   public void endlvl_099( )
   {
      if ( ( GXutil.strcmp(Gx_mode, "INS") != 0 ) )
      {
         pr_default.close(0);
      }
      if ( ( AnyError == 0 ) && ( sanomodError == 0 ) )
      {
         Application.commit(context, remoteHandle, "DEFAULT", "ttipodocume");
         /* After transaction rules */
         if ( ( GXutil.strcmp(Gx_mode, "INS") == 0 ) && true /* After */ )
         {
            GXv_int2[0] = 0 ;
            new pnumaut(remoteHandle, context).execute( "S", "NSTDO10", "TIPO DE DOCUMENTO IDENT.", AV15Userid, GXv_int2) ;
         }
         /* Execute 'After Trn' event if defined. */
         trnEnded = 1 ;
      }
      else
      {
         Application.rollback(context, remoteHandle, "DEFAULT", "ttipodocume");
      }
   }

   public void scanstart_099( )
   {
      /* Using cursor T000911 */
      pr_default.execute(9);
      RcdFound9 = 0 ;
      if ( (pr_default.getStatus(9) != 101) )
      {
         RcdFound9 = (short)(1) ;
         A53TIPDOCC = T000911_A53TIPDOCC[0] ;
      }
   }

   public void scannext_099( )
   {
      pr_default.readNext(9);
      RcdFound9 = 0 ;
      if ( (pr_default.getStatus(9) != 101) )
      {
         RcdFound9 = (short)(1) ;
         A53TIPDOCC = T000911_A53TIPDOCC[0] ;
      }
   }

   public void scanend_099( )
   {
      pr_default.close(9);
   }

   public void after_confirm_099( )
   {
      /* After confirm rules */
      if ( (GXutil.strcmp(Gx_mode, "INS")==0) && true /* After */ )
      {
         A179TipDoc = GXutil.serverDate( context, remoteHandle, "DEFAULT") ;
      }
      if ( (GXutil.strcmp(Gx_mode, "INS")==0) && true /* After */ )
      {
         A180TipDoc = GXutil.serverTime( context, remoteHandle, "DEFAULT") ;
      }
      if ( (GXutil.strcmp(Gx_mode, "INS")==0) && true /* After */ )
      {
         A181TipDoc = AV15Userid ;
      }
      if ( (GXutil.strcmp(Gx_mode, "INS")==0) && true /* After */ )
      {
         A182TipDoc = GXutil.nullDate() ;
      }
      else
      {
         if ( ( ( ( GXutil.strcmp(A54TipDocN, O54TipDocN) != 0 ) || ( GXutil.strcmp(A178TipDoc, O178TipDoc) != 0 ) ) ) && true /* After */ && (GXutil.strcmp(Gx_mode, "UPD")==0) && true /* After */ )
         {
            A182TipDoc = GXutil.serverDate( context, remoteHandle, "DEFAULT") ;
         }
      }
      if ( (GXutil.strcmp(Gx_mode, "INS")==0) && true /* After */ )
      {
         A184TipDoc = "" ;
      }
      else
      {
         if ( ( ( ( GXutil.strcmp(A54TipDocN, O54TipDocN) != 0 ) || ( GXutil.strcmp(A178TipDoc, O178TipDoc) != 0 ) ) ) && true /* After */ && (GXutil.strcmp(Gx_mode, "UPD")==0) && true /* After */ )
         {
            A184TipDoc = AV15Userid ;
         }
      }
      if ( (GXutil.strcmp(Gx_mode, "INS")==0) && true /* After */ )
      {
         A183TipDoc = "" ;
      }
      else
      {
         if ( ( ( ( GXutil.strcmp(A54TipDocN, O54TipDocN) != 0 ) || ( GXutil.strcmp(A178TipDoc, O178TipDoc) != 0 ) ) ) && true /* After */ && (GXutil.strcmp(Gx_mode, "UPD")==0) && true /* After */ )
         {
            A183TipDoc = GXutil.serverTime( context, remoteHandle, "DEFAULT") ;
         }
      }
   }

   public void confirm_090( )
   {
      if ( ( GXutil.strcmp(Gx_mode, "DLT") == 0 ) )
      {
         delete_controls099( ) ;
      }
      else
      {
         checket_099( ) ;
         close_checket_099( ) ;
      }
      if ( ( AnyError == 0 ) && ( sanomodError == 0 ) )
      {
         PreviousCaption = bttBtn_enter.getCaption() ;
         PreviousTooltip = bttBtn_enter.getTooltip() ;
         IsConfirmed = (short)(1) ;
      }
   }

   protected void cleanup( )
   {
      if (cleanedUp) {
         return  ;
      }
      if (!exitExecuted) {
         exitExecuted = true;
         GXExit();
      }
      super.cleanup();
      Application.cleanup(context, this, remoteHandle);
   }

   public void initialize( )
   {
      IsConfirmed = 0 ;
      trnEnded = 0 ;
      nKeyPressed = 0 ;
      PreviousTooltip = "" ;
      PreviousCaption = "" ;
      A54TipDocN = "" ;
      A179TipDoc = GXutil.nullDate() ;
      A181TipDoc = "" ;
      A180TipDoc = "" ;
      A182TipDoc = GXutil.nullDate() ;
      A184TipDoc = "" ;
      A183TipDoc = "" ;
      A185TipDoc = 0 ;
      O54TipDocN = "" ;
      X178TipDoc = "" ;
      A178TipDoc = "" ;
      O178TipDoc = "" ;
      X54TipDocN = "" ;
      AV34Pgmdes = "" ;
      Gx_BScreen = 0 ;
      A53TIPDOCC = 0 ;
      K53TIPDOCC = 0 ;
      i178TipDoc = "" ;
      lastAnyError = 0 ;
      GXt_char1 = "" ;
      AV30Wrkst = "" ;
      AV29Tipacu = 0 ;
      returnInSub = false ;
      sMode9 = "" ;
      RcdFound9 = 0 ;
      Z54TipDocN = "" ;
      Z179TipDoc = GXutil.nullDate() ;
      Z181TipDoc = "" ;
      Z180TipDoc = "" ;
      Z182TipDoc = GXutil.nullDate() ;
      Z184TipDoc = "" ;
      Z183TipDoc = "" ;
      Z178TipDoc = "" ;
      Z185TipDoc = 0 ;
      Gx_longc = false ;
      GX_JID = 0 ;
      T00094_A53TIPDOCC = new short[1] ;
      T00093_A53TIPDOCC = new short[1] ;
      T00093_A54TipDocN = new String[] {""} ;
      T00093_A179TipDoc = new java.util.Date[] {GXutil.nullDate()} ;
      T00093_A181TipDoc = new String[] {""} ;
      T00093_A180TipDoc = new String[] {""} ;
      T00093_A182TipDoc = new java.util.Date[] {GXutil.nullDate()} ;
      T00093_A184TipDoc = new String[] {""} ;
      T00093_A183TipDoc = new String[] {""} ;
      T00093_A178TipDoc = new String[] {""} ;
      T00093_A185TipDoc = new short[1] ;
      Z53TIPDOCC = 0 ;
      T00095_A53TIPDOCC = new short[1] ;
      T00096_A53TIPDOCC = new short[1] ;
      T00092_A53TIPDOCC = new short[1] ;
      T00092_A54TipDocN = new String[] {""} ;
      T00092_A179TipDoc = new java.util.Date[] {GXutil.nullDate()} ;
      T00092_A181TipDoc = new String[] {""} ;
      T00092_A180TipDoc = new String[] {""} ;
      T00092_A182TipDoc = new java.util.Date[] {GXutil.nullDate()} ;
      T00092_A184TipDoc = new String[] {""} ;
      T00092_A183TipDoc = new String[] {""} ;
      T00092_A178TipDoc = new String[] {""} ;
      T00092_A185TipDoc = new short[1] ;
      T000910_A35PrsCod = new String[] {""} ;
      GXv_int2 = new long [1] ;
      T000911_A53TIPDOCC = new short[1] ;
      pr_default = new DataStoreProvider(context, remoteHandle, new ttipodocume__default(),
         new Object[] {
             new Object[] {
            T00092_A53TIPDOCC, T00092_A54TipDocN, T00092_A179TipDoc, T00092_A181TipDoc, T00092_A180TipDoc, T00092_A182TipDoc, T00092_A184TipDoc, T00092_A183TipDoc, T00092_A178TipDoc, T00092_A185TipDoc
            }
            , new Object[] {
            T00093_A53TIPDOCC, T00093_A54TipDocN, T00093_A179TipDoc, T00093_A181TipDoc, T00093_A180TipDoc, T00093_A182TipDoc, T00093_A184TipDoc, T00093_A183TipDoc, T00093_A178TipDoc, T00093_A185TipDoc
            }
            , new Object[] {
            T00094_A53TIPDOCC
            }
            , new Object[] {
            T00095_A53TIPDOCC
            }
            , new Object[] {
            T00096_A53TIPDOCC
            }
            , new Object[] {
            }
            , new Object[] {
            }
            , new Object[] {
            }
            , new Object[] {
            T000910_A35PrsCod
            }
            , new Object[] {
            T000911_A53TIPDOCC
            }
         }
      );
      reloadDynamicLists(0);
      AV34Pgmdes = "Tipo de Documento" ;
      X178TipDoc = "1" ;
      A178TipDoc = "1" ;
      cmbTipDocEst.setValue(A178TipDoc);
      O178TipDoc = "1" ;
      i178TipDoc = "1" ;
      cmbTipDocEst.setValue(A178TipDoc);
      Z178TipDoc = "1" ;
      cmbTipDocEst.setValue(A178TipDoc);
   }

   protected byte geteqAfterKey= 1 ;
   protected byte nKeyPressed ;
   protected byte Gx_BScreen ;
   protected short IsConfirmed ;
   protected short A185TipDoc ;
   protected short A53TIPDOCC ;
   protected short K53TIPDOCC ;
   protected short AV16Tipdoc ;
   protected short RcdFound9 ;
   protected short Z185TipDoc ;
   protected short Z53TIPDOCC ;
   protected int trnEnded ;
   protected int lastAnyError ;
   protected int GX_JID ;
   protected long AV29Tipacu ;
   protected long GXv_int2[] ;
   protected String PreviousTooltip ;
   protected String PreviousCaption ;
   protected String A54TipDocN ;
   protected String A181TipDoc ;
   protected String A180TipDoc ;
   protected String A184TipDoc ;
   protected String A183TipDoc ;
   protected String O54TipDocN ;
   protected String X178TipDoc ;
   protected String A178TipDoc ;
   protected String O178TipDoc ;
   protected String X54TipDocN ;
   protected String AV34Pgmdes ;
   protected String i178TipDoc ;
   protected String AV31Tipdoc ;
   protected String AV32Prgcod ;
   protected String AV15Userid ;
   protected String AV9Cad ;
   protected String GXt_char1 ;
   protected String AV30Wrkst ;
   protected String sMode9 ;
   protected String Z54TipDocN ;
   protected String Z181TipDoc ;
   protected String Z180TipDoc ;
   protected String Z184TipDoc ;
   protected String Z183TipDoc ;
   protected String Z178TipDoc ;
   protected java.util.Date A179TipDoc ;
   protected java.util.Date A182TipDoc ;
   protected java.util.Date Z179TipDoc ;
   protected java.util.Date Z182TipDoc ;
   protected boolean returnInSub ;
   protected boolean Gx_longc ;
   protected GXPanel GXPanel1 ;
   protected GUIObjectShort edtTIPDOCCOD ;
   protected GUIObjectString edtTipDocNom ;
   protected GUIObjectString cmbTipDocEst ;
   protected IGXButton bttBtn_enter ;
   protected IGXButton bttBtn_cancel ;
   protected ILabel lbllbl6 ;
   protected ILabel lbllbl8 ;
   protected ILabel lbllbl10 ;
   protected IGXRectangle rctrct9 ;
   protected IGXRectangle rctRecuadro ;
   protected IDataStoreProvider pr_default ;
   protected short[] T00094_A53TIPDOCC ;
   protected short[] T00093_A53TIPDOCC ;
   protected String[] T00093_A54TipDocN ;
   protected java.util.Date[] T00093_A179TipDoc ;
   protected String[] T00093_A181TipDoc ;
   protected String[] T00093_A180TipDoc ;
   protected java.util.Date[] T00093_A182TipDoc ;
   protected String[] T00093_A184TipDoc ;
   protected String[] T00093_A183TipDoc ;
   protected String[] T00093_A178TipDoc ;
   protected short[] T00093_A185TipDoc ;
   protected short[] T00095_A53TIPDOCC ;
   protected short[] T00096_A53TIPDOCC ;
   protected short[] T00092_A53TIPDOCC ;
   protected String[] T00092_A54TipDocN ;
   protected java.util.Date[] T00092_A179TipDoc ;
   protected String[] T00092_A181TipDoc ;
   protected String[] T00092_A180TipDoc ;
   protected java.util.Date[] T00092_A182TipDoc ;
   protected String[] T00092_A184TipDoc ;
   protected String[] T00092_A183TipDoc ;
   protected String[] T00092_A178TipDoc ;
   protected short[] T00092_A185TipDoc ;
   protected String[] T000910_A35PrsCod ;
   protected short[] T000911_A53TIPDOCC ;
}

final class ttipodocume__default extends DataStoreHelperBase implements ILocalDataStoreHelper
{
   public Cursor[] getCursors( )
   {
      return new Cursor[] {
          new ForEachCursor("T00092", "SELECT [TIPDOCCOD], [TipDocNom], [TipDocFCR], [TipDocUCR], [TipDocHCR], [TipDocFUM], [TipDocUUM], [TipDocHUM], [TipDocEst], [TipDocCSu] FROM [MMTDO10] WITH (UPDLOCK) WHERE [TIPDOCCOD] = ? ",true, GX_NOMASK, false, this,0,false )
         ,new ForEachCursor("T00093", "SELECT [TIPDOCCOD], [TipDocNom], [TipDocFCR], [TipDocUCR], [TipDocHCR], [TipDocFUM], [TipDocUUM], [TipDocHUM], [TipDocEst], [TipDocCSu] FROM [MMTDO10] WITH (NOLOCK) WHERE [TIPDOCCOD] = ? ",true, GX_NOMASK, false, this,0,false )
         ,new ForEachCursor("T00094", "SELECT [TIPDOCCOD] FROM [MMTDO10] WITH (FASTFIRSTROW NOLOCK) WHERE [TIPDOCCOD] = ? ",true, GX_NOMASK, false, this,0,false )
         ,new ForEachCursor("T00095", "SELECT [TIPDOCCOD] FROM [MMTDO10] WITH (FASTFIRSTROW NOLOCK) WHERE ( [TIPDOCCOD] > ?) ORDER BY [TIPDOCCOD] ",true, GX_NOMASK, false, this,0,false )
         ,new ForEachCursor("T00096", "SELECT [TIPDOCCOD] FROM [MMTDO10] WITH (FASTFIRSTROW NOLOCK) WHERE ( [TIPDOCCOD] < ?) ORDER BY [TIPDOCCOD] DESC ",true, GX_NOMASK, false, this,0,false )
         ,new UpdateCursor("T00097", "INSERT INTO [MMTDO10] ([TIPDOCCOD], [TipDocNom], [TipDocFCR], [TipDocUCR], [TipDocHCR], [TipDocFUM], [TipDocUUM], [TipDocHUM], [TipDocEst], [TipDocCSu]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", GX_NOMASK)
         ,new UpdateCursor("T00098", "UPDATE [MMTDO10] SET [TipDocNom]=?, [TipDocFCR]=?, [TipDocUCR]=?, [TipDocHCR]=?, [TipDocFUM]=?, [TipDocUUM]=?, [TipDocHUM]=?, [TipDocEst]=?, [TipDocCSu]=?  WHERE [TIPDOCCOD] = ?", GX_NOMASK)
         ,new UpdateCursor("T00099", "DELETE FROM [MMTDO10]  WHERE [TIPDOCCOD] = ?", GX_NOMASK)
         ,new ForEachCursor("T000910", "SELECT [PrsCod] FROM [MMPRS10] WITH (NOLOCK) WHERE [TIPDOCCOD] = ? ",true, GX_NOMASK, false, this,0,false )
         ,new ForEachCursor("T000911", "SELECT [TIPDOCCOD] FROM [MMTDO10] WITH (FASTFIRSTROW NOLOCK) ORDER BY [TIPDOCCOD] ",true, GX_NOMASK, false, this,0,false )
      };
   }

   public void getResults( int cursor ,
                           IFieldGetter rslt ,
                           Object[] buf ) throws SQLException
   {
      switch ( cursor )
      {
            case 0 :
               ((short[]) buf[0])[0] = rslt.getShort(1) ;
               ((String[]) buf[1])[0] = rslt.getString(2, 20) ;
               ((java.util.Date[]) buf[2])[0] = rslt.getGXDate(3) ;
               ((String[]) buf[3])[0] = rslt.getString(4, 10) ;
               ((String[]) buf[4])[0] = rslt.getString(5, 8) ;
               ((java.util.Date[]) buf[5])[0] = rslt.getGXDate(6) ;
               ((String[]) buf[6])[0] = rslt.getString(7, 10) ;
               ((String[]) buf[7])[0] = rslt.getString(8, 8) ;
               ((String[]) buf[8])[0] = rslt.getString(9, 1) ;
               ((short[]) buf[9])[0] = rslt.getShort(10) ;
               break;
            case 1 :
               ((short[]) buf[0])[0] = rslt.getShort(1) ;
               ((String[]) buf[1])[0] = rslt.getString(2, 20) ;
               ((java.util.Date[]) buf[2])[0] = rslt.getGXDate(3) ;
               ((String[]) buf[3])[0] = rslt.getString(4, 10) ;
               ((String[]) buf[4])[0] = rslt.getString(5, 8) ;
               ((java.util.Date[]) buf[5])[0] = rslt.getGXDate(6) ;
               ((String[]) buf[6])[0] = rslt.getString(7, 10) ;
               ((String[]) buf[7])[0] = rslt.getString(8, 8) ;
               ((String[]) buf[8])[0] = rslt.getString(9, 1) ;
               ((short[]) buf[9])[0] = rslt.getShort(10) ;
               break;
            case 2 :
               ((short[]) buf[0])[0] = rslt.getShort(1) ;
               break;
            case 3 :
               ((short[]) buf[0])[0] = rslt.getShort(1) ;
               break;
            case 4 :
               ((short[]) buf[0])[0] = rslt.getShort(1) ;
               break;
            case 8 :
               ((String[]) buf[0])[0] = rslt.getString(1, 10) ;
               break;
            case 9 :
               ((short[]) buf[0])[0] = rslt.getShort(1) ;
               break;
      }
   }

   public void setParameters( int cursor ,
                              IFieldSetter stmt ,
                              Object[] parms ) throws SQLException
   {
      switch ( cursor )
      {
            case 0 :
               stmt.setShort(1, ((Short) parms[0]).shortValue());
               break;
            case 1 :
               stmt.setShort(1, ((Short) parms[0]).shortValue());
               break;
            case 2 :
               stmt.setShort(1, ((Short) parms[0]).shortValue());
               break;
            case 3 :
               stmt.setShort(1, ((Short) parms[0]).shortValue());
               break;
            case 4 :
               stmt.setShort(1, ((Short) parms[0]).shortValue());
               break;
            case 5 :
               stmt.setShort(1, ((Short) parms[0]).shortValue());
               stmt.setString(2, (String)parms[1], 20);
               stmt.setDate(3, (java.util.Date)parms[2]);
               stmt.setString(4, (String)parms[3], 10);
               stmt.setString(5, (String)parms[4], 8);
               stmt.setDate(6, (java.util.Date)parms[5]);
               stmt.setString(7, (String)parms[6], 10);
               stmt.setString(8, (String)parms[7], 8);
               stmt.setString(9, (String)parms[8], 1);
               stmt.setShort(10, ((Short) parms[9]).shortValue());
               break;
            case 6 :
               stmt.setString(1, (String)parms[0], 20);
               stmt.setDate(2, (java.util.Date)parms[1]);
               stmt.setString(3, (String)parms[2], 10);
               stmt.setString(4, (String)parms[3], 8);
               stmt.setDate(5, (java.util.Date)parms[4]);
               stmt.setString(6, (String)parms[5], 10);
               stmt.setString(7, (String)parms[6], 8);
               stmt.setString(8, (String)parms[7], 1);
               stmt.setShort(9, ((Short) parms[8]).shortValue());
               stmt.setShort(10, ((Short) parms[9]).shortValue());
               break;
            case 7 :
               stmt.setShort(1, ((Short) parms[0]).shortValue());
               break;
            case 8 :
               stmt.setShort(1, ((Short) parms[0]).shortValue());
               break;
      }
   }

}

